Conversation
|
So, while this took a lot longer to respond, maybe there is still some usage for this migration. Originally, I found that it was more useful to migrate everything to the WASM version of Superstring. Unfortunately, on very big files (8k to 15k) the editor is struggling and typing lag is clearly visible and it interferes with the workflow. So I'll be testing these changes on the PR to see if they work on newer Electron, and how much impact they do. |
|
Quick update - it works, but not 100%. It crashes with the error: Basically, the Subsequence matcher is defined here on Superstring, but I remember it was some of the things that crashed the editor |
|
@bongnv, after A LOT of testing, I have to say - GREAT JOB! The Subsequence matcher bug happens some times (but not always - not sure why, honestly, but I feel I can work on a fix) and this fork is being used on the newer Electron. As soon as I work on a fix, I feel we can merge this! I also saw some bugs on VIM Mode that, supposedly, start from Superstring but I need to reproduce them and be sure they are not also happening on the "stable" version of Superstring too. |
|
Closing this because we finally migrated to N-API in #18 after several attempts. All of these earlier PRs that attempted the N-API migration were important to consult, as was tree-sitter-node#190 — serving as an example of how to achieve context awareness by maintaining context-specific constructors as addon data. Thanks! |
This PR migrates
superstringto n-api. It passed all unit tests with a few caveats:v8::Set,v8::RegExpandnode::ErrnoExceptionaren't available in n-api so I usedJsValueFromV8LocalValueto convertv8::Valuetonapi_valueafter using v8 and node API directly.static Napi::FunctionReference constructortree-sitterbecausetree-sitteruses nan-API ofsuperstring(ref)deletewas removed because it's 'noop'